The invention relates to methods and systems for assisting users of computer databases. More particularly the invention relates to ways of counting and displaying occurrences of data records in databases. Even more particularly the invention relates to such ways as applied to non-relational databases.
Computer and information system users are familiar with handling data stored in a database. One well-known form of database, displays stored data in the form of a spreadsheet having rows and columns where data either numeric or text, formulas, or graphical information is placed at the intersection of a particular row and a particular column, typically called a cell. The text may also include reference to other data such as a URL (uniform reference locator) address of a web page on the internet where the other data is stored.
Another type of well-known database is a hierarchical database. As defined in the Dictionary of Computing @ 1987 published by IBM Corporation, Box 390, Poughkeepsie, N.Y. 12602 document SC20-1699-07, a hierarchical database is xe2x80x9corganized in the form of a tree structure in which each recordxe2x80x9d . . . xe2x80x9chas only one owner, that represents how the recordsxe2x80x9d . . . xe2x80x9care interrelated, and that predetermines the access paths to data stored in the base.xe2x80x9d
In a network database xe2x80x9ceach record except the root record may have several owners and there may be several access paths to each recordxe2x80x9d as defined in the Dictionary of Computing.
Another type of database is a relational database which is defined in the Dictionary of Computing as xe2x80x9ca database that is organized and accessed according to relationships between data itemsxe2x80x9d . . . xe2x80x9cData items are accessed by matching values and not by following pre-defined paths.xe2x80x9d
All of the databases described above except the last as well as many others are known in the art as non-relational databases. It is well known that some databases have data added and removed very frequently often by many users. For example a purchasing database at a large company may be updated at any time by any buyer in the purchasing function. This may be several hundred employees located at various sites worldwide.
A common problem that exists with data stored in non-relational databases is determining the numbers of occurrences of a particular category or sub-category of data in the database. In the example above, a purchasing manager may need to know how many purchase orders were placed in the preceding week by any of the buyers. Or (s)he may need to have this information displayed by category of purchase order.
Current tools for accessing non-relational databases permit summing of the values in fields of records. For example to quickly determine the total dollar value of all selected purchase orders a user would invoke a sum function or formula. In some spreadsheets a user would enter in a cell the formula=SUM ( ) where the cell positions of the desired data to be summed are indicated within the parenthesis. The spreadsheet program then forms the sum and places the result in the cell containing the formula. However, with some non relational database tools such as Lotus Notes, a user who wishes to count the number of items of data in a category or sub category has no corresponding counting formula to use. It is therefore a desirable objective to have a method of counting occurrences of data items.
With some spreadsheet database tools such as Lotus 1,2,3-97 Edition a built-in count function may be used to count the number of nonblank cells in a range of cells. It is also well known in the art to store only the nonblank cells and not store the blank cells. While providing some limited counting capability, this built-in count function may not address all requirements for counting occurrences in the stored data such as weighting one type of data record occurrence differently than another. To check for a balance, one type may be weighted with a value of +1 and another type weighted xe2x88x921. In this case the number of data record occurrences should equal zero. An alternative method of counting occurrences with less restrictive capability would be a desirable improvement in the use of such spreadsheet database tools.
Shakib et al in U.S. Pat. No. 5,752,025 describe a way of organizing and viewing large amounts of data by creating and displaying a categorization table for a set of data records. The categorization table organizes data under successive, often heirarchical, and expandable levels of categorized headings. Such headings give a user information as to the nature of the underlying sub-headings or data grouped under particular headings or sub-headings. The categorization table is built from a header table which itself is built by sorting data records or an index table to the data records by pre-defined categories. A count value field in the header table gives the number of data records in each sort category so that if it is desired to access the data for a particular category, that data can be accessed by knowing the location of the first record and the number of records in that particular category. The size of the header table is usually much less than the data records themselves and therefore permits display of various categorization tables without sorting through the data records each time a new view or new categorization table is requested by a user.
In accordance with the teachings of the present invention, there is defined a new method of counting occurrences of data items of a particular category or sub-category in a non-relational database. It is believed that such a method would constitute a significant advancement in the art.
It is therefore a principal object of the present invention to enhance the computer database art by providing a broad method of counting occurrences of data items.
It is another object to provide a method of displaying the number of occurrences of data items.
It is another object to provide a data processing apparatus for counting occurrence of data items in a non-relational database.
It is yet another object to provide a computer program product of program instruction means recorded on a computer readable medium for counting occurrences of data item in a database.
These and other objects are attained in accordance with one embodiment of the invention wherein there is provided a method of counting occurrences of data in a non-relational database, comprising the steps of, selecting rows of data from a non-relational database, creating a counter field and appending the counter field to the selected rows, weighting the counter field with a fixed value, and applying a summation to the counter field to count occurrences of the selected rows of data.
In accordance with another embodiment of the invention there is provided a method of displaying data records in a non-relational database, comprising the steps of, selecting data records from a non-relational database, creating a counter field and appending the counter field to the selected data records, weighting the counter field with a fixed value to form weighted occurrences, sorting the selected data records into categories, applying a summation to the counter field to count weighted occurrences of the selected data records in each category, and displaying the sorted data records by columns of the categories and a column indicating the weighted occurrences for each category.
In accordance with another embodiment of the invention there is provided a data processing apparatus for counting occurrences of data in a non-relational database, the apparatus comprising, means for selecting rows of data from a non-relational database, means for creating a counter field and appending the counter field to the selected rows, means for weighting the counter field with a fixed value, and means for applying a summation to the counter field to count occurrences of the data.
In accordance with yet another embodiment of the invention there is provided a computer program product for counting occurrences of data in a non- relational database, the computer program product comprising, a computer readable medium, first program instruction means for selecting rows of data from a non-relational database, second program instruction means for creating a counter field and appending the counter field to the selected rows, third program instruction means for weighting the counter field with a fixed value, fourth program instruction means for applying a summation to the counter field to count occurrences of the data; and wherein all said program instruction means are recorded on the medium.